<?php echo $this->Session->flash(); ?>
<div  id="loadimg" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>
<fieldset>
    <legend>FUENTES DE AGUA</legend>
    <table border="1">
        <thead>

            <tr>
                <td>32. FUENTES DE AGUA</td>
                <td>33. CAUDAL</td>
                <td>Uso Domestico</td>
                <td>Uso Agricultura</td>
                <td>Uso Ganaderia</td>
                <td>Uso Pisicola</td>
                <td>35 DISPONIBILIDAD</td>
                <td>DESCRIPCION</td>
                <td colspan="2"></td>
            </tr>

        </thead>
        <tbody>
            <?php foreach ($waters as $wt): ?>

                <tr>
                    <td><?php echo $wt['WaterSource']['name']; ?></td>
                    <td><?php echo $wt['WaterPoll']['caudal']; ?></td>
                    <td><?php
            if ($wt['WaterPoll']['uso_domestico']) {
                echo "Si";
            } else {
                echo "No";
            }
                ?></td>
                    <td><?php
                    if ($wt['WaterPoll']['uso_agricultura']) {
                        echo "Si";
                    } else {
                        echo "No";
                    }
                    ?></td>
                    <td><?php
                    if ($wt['WaterPoll']['uso_ganaderia']) {
                        echo "Si";
                    } else {
                        echo "No";
                    }
                ?></td>
                    <td><?php
                    if ($wt['WaterPoll']['uso_piscicola']) {
                        echo "Si";
                    } else {
                        echo "No";
                    }
                    ?></td>
                    <td><?php echo $wt['WaterPoll']['disponibilidad']; ?></td>
                    <td><?php echo $wt['WaterPoll']['descripcion']; ?></td>
                    <td><?php
                    if ($usuario['User']['group_id'] != 5 && $usuario['User']['group_id'] != 6 && $visto_bueno['Poll']['visto_bueno'] != 'Si') {
                        echo $ajax->link("Editar", array('controller' => 'WaterPolls', "action" => "edit", $wt['WaterPoll']['id']), array('update' => 'waters', 'indicator' => 'loading'));
                    }
                    ?></td>
                    <td><?php 
                    if ($usuario['User']['group_id'] != 5 && $usuario['User']['group_id'] != 6 && $visto_bueno['Poll']['visto_bueno'] != 'Si') {
                        echo $ajax->link("Eliminar", array('controller' => 'WaterPolls', "action" => "delete", $wt['WaterPoll']['id'], $this->data['WaterPoll']['poll_id']), array('update' => 'waters', 'indicator' => 'loading'), '¿Desea Eliminar El Registro?');
                    } ?></td>

                </tr>

<?php endforeach; ?>
        </tbody>
    </table>
<?php 
if ($usuario['User']['group_id'] != 5 && $usuario['User']['group_id'] != 6 && $visto_bueno['Poll']['visto_bueno'] != 'Si') {
    echo $ajax->link("Adicionar", array('controller' => 'WaterPolls', "action" => "add", $this->data['WaterPoll']['poll_id']), array('update' => 'waters', 'indicator' => 'loading'));
}
 ?>
</fieldset>
